package data;

import java.util.Observable;
import java.util.Observer;

import javax.swing.JLabel;

public class ModeleChrono implements Observer{
	JLabel chronolabel;
	
	public ModeleChrono(JLabel chronolabel){
		this.chronolabel = chronolabel;
	}
	@Override
	public void update(Observable o, Object arg) {
		Chrono c = (Chrono) o;
		Temps t = c.getChrono();
		if(t.conversion() <= 0){
			// partie finie
			this.chronolabel.setText("- Partie Finie -");
		}
		else {
			this.chronolabel.setText(t.toString());
		}
	}

}
